package com.tuling.service;

import com.tuling.dao.FruitDao;
import com.tuling.dao.FruitDaoImpl;
import com.tuling.domain.Fruit;

import java.util.List;

public class FruitServiceImpl implements FruitService{
    private FruitDao fruitDao = new FruitDaoImpl();
    @Override
    public List<Fruit> findHot() {
        return fruitDao.getHot();
    }

    @Override
    public Fruit findById(int id) {
        return fruitDao.getById(id);
    }

    @Override
    public List<Fruit> findByKey(String key) {
        return fruitDao.getByKey(key);
    }

    @Override
    public List<Fruit> getAll() {
        return fruitDao.getAll();
    }

    @Override
    public int add(Fruit fruit) {
        return fruitDao.add(fruit);
    }

    @Override
    public int update(Fruit fruit) {
        return fruitDao.update(fruit);
    }

    @Override
    public int del(int fid) {
        return fruitDao.del(fid);
    }
}
